package org.example.pojo;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

// @Component 等价于 <bean id="user" class="org.example.pojo.User"/>
@Component
@Scope("singleton")
public class User {
    @Value("foobar") // 为属性添加值，等价于 <property name="name" value="foobar"/>
    private String name;
}
